﻿using BCCommon.TMS.FreightEnums;
using BCEntity.TMS.HorsemanFreightConfiguration;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace BCData.TMS.HorsemanFreightConfiguration
{
    public interface IHorsemanFreightConfigurationData
    {
        /// <summary>
        /// 新增骑手运费配置
        /// </summary>
        /// <param name="entity">骑手运费配置信息</param>
        /// <returns></returns>
        Task<HorsemanFreightConfigurationEntity> InserAsync(HorsemanFreightConfigurationEntity entity);

        /// <summary>
        /// 检查骑手运费配置是否存在
        /// </summary>
        /// <param name="horsemanFreightConfigurationId">骑手运费配置Id</param>
        /// <returns></returns>
        Task<bool> CheckExistsAsync(long horsemanFreightConfigurationId);

        /// <summary>
        /// 检查骑手运费配置是否存在
        /// </summary>
        /// <param name="countyCode">区县编码</param>
        /// <returns></returns>
        Task<bool> CheckExistsAsync(string countyCode);

        /// <summary>
        /// 修改骑手运费配置
        /// </summary>
        /// <param name="entity">骑手运费配置信息</param>
        /// <returns></returns>
        Task<HorsemanFreightConfigurationEntity> UpdateAsync(HorsemanFreightConfigurationEntity entity);

        /// <summary>
        /// 删除骑手运费配置
        /// </summary>
        /// <param name="horsemanFreightConfigurationId">运费配置id</param>
        /// <returns></returns>
        Task<bool> DeleteAsync(long horsemanFreightConfigurationId);


        /// <summary>
        /// 获取骑手运费配置（分页）
        /// </summary> 
        /// <param name="isBase">是否是基础骑手运费配置</param>     
        /// <param name="countyCodes">区县编码</param>  
        /// <param name="distanceCalculateType">距离计算类型</param>  
        /// <param name="ascending">是否升序排序</param>
        /// <param name="sortName">排序字段</param>
        /// <param name="pageIndex">当前页</param>
        /// <param name="pageSize">每页条数</param>
        Task<(IEnumerable<HorsemanFreightConfigurationViewEntity>, int)> GetListAsync(bool? isBase, List<string> countyCodes, DistanceCalculateType? distanceCalculateType, bool? ascending, string sortName, int pageIndex, int pageSize);

        /// <summary>
        /// 获取骑手平台基础运费配置
        /// </summary>
        /// <returns></returns>
        Task<IEnumerable<HorsemanFreightConfigurationEntity>> GetByCountyCodeAsync();
        /// <summary>
        /// 根据区县编码获取骑手运费配置
        /// </summary>
        /// <param name="countyCode">区县编码</param>
        /// <returns></returns>
        Task<IEnumerable<HorsemanFreightConfigurationEntity>> GetByCountyCodeAsync(string countyCode);
        /// <summary>
        /// 根据区县编码获取骑手运费配置
        /// </summary>
        /// <param name="horsemanFreightConfigurationId">骑手运费配置Id</param>
        /// <returns></returns>
         Task<HorsemanFreightConfigurationEntity> GetByHorsemanFreightConfigurationIdAsync(long horsemanFreightConfigurationId);
    }
}
